﻿@{
    ViewBag.Title = "申请品牌";
    ViewBag.NavTitle = "申请品牌";
    Layout = "~/Views/Shared/_UsersCenterLayout.cshtml";
}
@using MvcMall.Portal.Controllers.Stores.ViewModels;
@model ApplyGoodsBrandModel
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        GetParentGoodsCat();
        $('#parentGoodsCat').change(function () { GetChildGoodsCat() });
    });

    function GetParentGoodsCat() {
        $('#parentGoodsCat').empty();
        $("#GoodsCat").empty();
        $("<option></option>")
                    .val("请选择")
                    .text("请选择")
                    .appendTo($('#parentGoodsCat'));

        $.getJSON("/Ajax/GetGoodsCatsByGrade/1", function (data) {
            $.each(data, function (i, item) {
                $("<option></option>")
                    .val(item["Value"])
                    .text(item["Text"])
                    .appendTo($('#parentGoodsCat'));
            });
        });
    }

    function GetChildGoodsCat() {
        $("#GoodsCat").empty();
        $("<option></option>")
                    .val("请选择")
                    .text("请选择")
                    .appendTo($('#GoodsCat'));
        var url = "/Ajax/GetChildGoodsCats/" + $('#parentGoodsCat').val();
        $.getJSON(url, function (data) {
            $.each(data, function (i, item) {
                $("<option></option>")
                    .val(item["Value"])
                    .text(item["Text"])
                    .appendTo($('#GoodsCat'));
            });
        });
    }
</script>
<div class="right_box">
    <div class="right_box_map">
        申请品牌
    </div>
    <div class="right_box_card">
        <ul>
            <li class="right_box_card2">@Html.ActionLink("品牌列表", "GoodsBrands", "Stores", null, null)</li>
            <li class="right_box_card1"><a href="#">申请品牌</a></li>
        </ul>
    </div>
    @using (Html.BeginForm("ApplyGoodsBrand", "Stores", null, FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        <table style="margin-top: 10px;" width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr height="40">
                <td class="tab2_td">
                    @Html.LabelFor(c => c.GoodsCat)：
                </td>
                <td>
                    <select id="parentGoodsCat" name="parentGoodsCat" style=" width:200px;">
                    </select>
                    <select id="GoodsCat" name="GoodsCat" style=" width:200px;">
                    </select>
                </td>
                <td>
                    @Html.ValidationMessageFor(c => c.GoodsCat)
                </td>
            </tr>
            <tr height="40">
                <td class="tab2_td">
                    @Html.LabelFor(c => c.BrandName)：
                </td>
                <td>
                    @Html.TextBoxFor(c => c.BrandName, new { @class = "tab_input", @style = " width:150px;" })
                </td>
                <td>
                    @Html.ValidationMessageFor(c => c.BrandName)
                </td>
            </tr>
            <tr height="40">
                <td class="tab2_td">
                    @Html.LabelFor(c => c.BrandImage)：
                </td>
                <td>
                    <input type="file" id="brandImage" name="brandImage" />
                </td>
                <td>
                    @Html.ValidationMessageFor(c => c.BrandImage)
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td colspan="2">
                    <input type="submit" value="提交申请" />
                </td>
            </tr>
        </table>
    }
</div>
